﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CmpEdu
{
    /// <summary>
    /// 定义抽象类，几何体
    /// </summary>
    public abstract class Sharp
    {
        protected double sharpx;
        protected double sharpy;
        protected double sharpz;

        /// <summary>
        /// 定义该类的构造函数，三个参数
        /// </summary>
        /// <param name="x"></param>
        /// <param name="y"></param>
        /// <param name="z"></param>
        public Sharp(double x, double y, double z)
        {
            sharpx = x;
            sharpy = y;
            sharpz = z;
        }

        public abstract double Cubage();        
    }

    public class Cuboid1:Sharp
    {
        public Cuboid1(double l,double w,double h) : base(l, w, h) { }

        public override double Cubage()
        {
            return sharpx * sharpy * sharpz;
        }
    }
}
